package br.gov.dataprev.treinamento.ejb.modelo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="TELEFONES_CLIENTES")
public class Telefone implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@Id
	@SequenceGenerator(name="SQ_TELEFONES_CLIENTES")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SQ_TELEFONES_CLIENTES")
	@Column(name="ID_TELEFONE")
	private Long id;
	
	@Column(name="NU_DDD", nullable=false, length=2)
	private Short ddd;
	
	
	@Column(name="NU_TELEFONE", nullable=false)
	private Integer telefone;


	public Telefone() {
		super();
		// TODO Auto-generated constructor stub
	}


	public Long getId() {
		return id;
	}


	public void setId(Long id) {
		this.id = id;
	}


	public Short getDdd() {
		return ddd;
	}


	public void setDdd(Short ddd) {
		this.ddd = ddd;
	}


	public Integer getTelefone() {
		return telefone;
	}


	public void setTelefone(Integer telefone) {
		this.telefone = telefone;
	}


	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}


	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof Telefone))
			return false;
		Telefone other = (Telefone) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	
}
